From 0e86016442117d8ababe9f6a5907a0d5edd5b47e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 15 Mar 2005 15:00:11 +0000 Subject: [PATCH] Document that inline completion requires text-column to be set. 2005-03-15 Matthias Clasen * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): Document that inline completion requires text-column to be set. (gtk_entry_completion_compute_prefix): Return NULL if text-column is not set. * gtk/gtkentry.c (check_completion_callback): Call gtk_entry_completion_complete() before inserting the prefix, otherwise the prefix may depend on (random) state of the filter model. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gtk/gtkentry.c | 1 + gtk/gtkentrycompletion.c | 10 ++++++++-- 5 files changed, 45 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77366d3afd..e6b0b27386 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-03-15 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): + Document that inline completion requires text-column to be set. + (gtk_entry_completion_compute_prefix): Return NULL if text-column + is not set. + + * gtk/gtkentry.c (check_completion_callback): Call + gtk_entry_completion_complete() before inserting the prefix, + otherwise the prefix may depend on (random) state of the + filter model. + 2005-03-15 Anders Carlsson * docs/iconcache.txt: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 77366d3afd..e6b0b27386 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +2005-03-15 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): + Document that inline completion requires text-column to be set. + (gtk_entry_completion_compute_prefix): Return NULL if text-column + is not set. + + * gtk/gtkentry.c (check_completion_callback): Call + gtk_entry_completion_complete() before inserting the prefix, + otherwise the prefix may depend on (random) state of the + filter model. + 2005-03-15 Anders Carlsson * docs/iconcache.txt: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 77366d3afd..e6b0b27386 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +2005-03-15 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): + Document that inline completion requires text-column to be set. + (gtk_entry_completion_compute_prefix): Return NULL if text-column + is not set. + + * gtk/gtkentry.c (check_completion_callback): Call + gtk_entry_completion_complete() before inserting the prefix, + otherwise the prefix may depend on (random) state of the + filter model. + 2005-03-15 Anders Carlsson * docs/iconcache.txt: diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index b26cdda5d4..0659e12bf3 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -5200,6 +5200,7 @@ check_completion_callback (GtkEntryCompletion *completion) { completion->priv->check_completion_idle = NULL; + gtk_entry_completion_complete (completion); gtk_entry_completion_insert_prefix (completion); return FALSE; diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index 4a9028d5e1..9672e48317 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -303,7 +303,9 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass) * GtkEntryCompletion:inline-completion: * * Determines whether the common prefix of the possible completions - * should be inserted automatically in the entry. + * should be inserted automatically in the entry. Note that this + * requires text-column to be set, even if you are using a custom + * match function. * * Since: 2.6 **/ @@ -1412,8 +1414,12 @@ gtk_entry_completion_compute_prefix (GtkEntryCompletion *completion) GtkTreeIter iter; gchar *prefix = NULL; gboolean valid; + const gchar *key; - const gchar *key = gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)); + if (completion->priv->text_column < 0) + return NULL; + + key = gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)); valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (completion->priv->filter_model), &iter); -- 2.30.2